import request from '../utils/request'

export function getRoleLists(params) {
    return request({
        url: '/sys/role',
        method: 'get',
        params
    })
}

export function delRole(id) {
    return request({
        url: `/sys/role/${id}`,
        method: 'delete',
    })
}

export function addRole(data) {
    return request({
        url: '/sys/role',
        method: 'post',
        data
    })
}

// 修改人员信息
export function editRole(data) {
    return request({
        url: `/sys/role/${data.id}`,
        method: 'put',
        data
    })
}
export function getRole(id) {
    return request({
        url: `/sys/role/${id}`,
    })
}

// 获取公司信息
export function getCompany(id) {
    return request({
        url: `/company/${id}`,
        method:'get'
    })
}

// 给角色分配权限
export function assignPermission(data) {
    return request({
        url: '/sys/role/assignPrem',
        method: 'put',
        data
    })
}